package base.day08;

/**
 * 描述：
 * 打印出所有的子序列
 *
 * @author hl
 * @version 1.0
 * @date 2020/11/1 17:10
 */
public class Print_All_Subsquences {
    public static void printAllSubsquence(int n, char[] chs, String str) {
        if (n == chs.length) {
            System.out.println(str);
            return ;
        }
        printAllSubsquence(n + 1, chs, str);
        printAllSubsquence(n + 1, chs, str + chs[n]);
    }

    public static void main(String[] args) {
        String string = "abc";
        printAllSubsquence(0,string.toCharArray(), "");
    }
}
